package cn.gzjp.modules.logis.service;

import java.util.List;

import cn.gzjp.modules.logis.entity.LogisUser;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.gzjp.common.persistence.Page;
import cn.gzjp.common.service.CrudService;
import cn.gzjp.modules.logis.entity.LogisCar;
import cn.gzjp.modules.logis.dao.LogisCarDao;

/**
 * 司机车辆Service
 * @author zengcp
 * @version 2018-04-03
 */
@Service
@Transactional(readOnly = true)
public class LogisCarService extends CrudService<LogisCarDao, LogisCar> {

	public LogisCar get(String id) {
		return super.get(id);
	}
	
	public List<LogisCar> findList(LogisCar logisCar) {
		return super.findList(logisCar);
	}
	
	public Page<LogisCar> findPage(Page<LogisCar> page, LogisCar logisCar) {
		return super.findPage(page, logisCar);
	}
	
	@Transactional(readOnly = false)
	public void save(LogisCar logisCar) {
		LogisCar m = get(logisCar.getId());
		if(m!=null){
			super.save(logisCar);
		}else{
			super.insert(logisCar, logisCar.getId());
		}
	}
	
	@Transactional(readOnly = false)
	public void delete(LogisCar logisCar) {
		super.deleteByLogic(logisCar);
	}
	
}